include(CMakeForceCompiler)
# this one is important
SET(CMAKE_SYSTEM_NAME Linux)
set( CMAKE_SYSTEM_PROCESSOR arm ) 
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)

# specify the cross compiler
SET(CMAKE_C_COMPILER   arm-hisiv100nptl-linux-gcc)
SET(CMAKE_CXX_COMPILER arm-hisiv100nptl-linux-g++)
SET(CMAKE_STRIP arm-hisiv100nptl-linux-strip)
#CMAKE_FORCE_C_COMPILER(arm-arago-linux-gnueabi-gcc GNU)
#CMAKE_FORCE_CXX_COMPILER(arm-arago-linux-gnueabi-g++ GNU)
# where is the target environment 
#SET(CMAKE_FIND_ROOT_PATH  "/mnt/hgfs/Share/cmake project/libvznet")

# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

##########################################################
## Step 1 
SET(VZ_S_BASE_DIR "/mnt/hgfs/work/vz_s_baseclass")
SET(BOOST_1_53_DIR "/mnt/hgfs/work/boost_1_53_0")

##1. INCLUDE_DIRECTORES
SET(VZPROJECT_INCLUDE_DIR
	${VZ_S_BASE_DIR}/vz_log/glog-0.3.3/src
	${BOOST_1_53_DIR}
	${PROJECT_SOURCE_DIR}/src/third_part
	${PROJECT_SOURCE_DIR}/src/lib
	${VZ_S_BASE_DIR}/app_headers
	/mnt/hgfs/work/event_server/OrgCode/branch_star/ipnc_app/interface/inc
)

MESSAGE(STATUS "       Add library path and name")
if(CMAKE_BUILD_TYPE MATCHES Debug)
	MESSAGE(STATUS "       Debug Mode")
	IF(CMAKE_BUILD_PLATFORM MATCHES HISI)
	SET(VZPROJECT_LIBRARY_DIR
		${VZ_S_BASE_DIR}/vz_log/glog-0.3.3/lib/hisi
		${BOOST_1_53_DIR}/hisi/lib
		${VZ_S_BASE_DIR}/jsoncpp/lib/arm3730
		${PROJECT_SOURCE_DIR}/lib/hisi
		)
	SET(VZPROJECT_LINK_LIB
		libglog.a
		libsqlite3.lib
		# Add Json library
		libboost_thread.a
		libboost_system.a
		libboost_random.a
		pthread
		rt
		)
elseif(CMAKE_BUILD_TYPE MATCHES Release)
	MESSAGE(STATUS "       Release Mode")
	SET(VZPROJECT_LIBRARY_DIR
		${VZ_S_BASE_DIR}/vz_log/glog-0.3.3/lib/hisi
		${BOOST_1_53_DIR}/hisi/lib
		${VZ_S_BASE_DIR}/jsoncpp/lib/arm6446
		${PROJECT_SOURCE_DIR}/lib/hisi
		)
	SET(VZPROJECT_LINK_LIB
		libglog.a
		libsqlite3.a
		libboost_thread.a
		libboost_system.a
		boost_random
		pthread
		rt
		)
endif()

MESSAGE(STATUS "Step 4 : Add code source")
ADD_DEFINITIONS(-DGOOGLE_GLOG_DLL_DECL=
	-O2
	)

SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY  "${PROJECT_SOURCE_DIR}/bin/hisi")
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY  "${PROJECT_SOURCE_DIR}/lib/hisi")
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY  "${PROJECT_SOURCE_DIR}/lib/hisi")

SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG  "${PROJECT_SOURCE_DIR}/bin/hisi")
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG  "${PROJECT_SOURCE_DIR}/lib/hisi")
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG  "${PROJECT_SOURCE_DIR}/lib/hisi")

# With Release properties
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE  "${PROJECT_SOURCE_DIR}/bin/hisi")
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE  "${PROJECT_SOURCE_DIR}/lib/hisi")
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE  "${PROJECT_SOURCE_DIR}/lib/hisi")